package com.study;

import com.study.bean.TeacherService;
import com.study.configuration.SpringConfiguration;
import com.study.model.Teacher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/*Spring单元测试组件*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfiguration.class)
public class TestSpringJunit {

    @Autowired
    TeacherService teacherService;

    @Test
    public void test() {
        teacherService.save(new Teacher());
        teacherService.save(null);
    }
}
